﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AssetManagementSystem.Model.IDao {
    public interface ILoanDAO {
        /// <summary>
        /// Create a new loan in the database, from a 'Loan' business object.
        /// </summary>
        /// <param name="loan">The loan object to be stored in the database</param>
        void CreateLoan(Loan loan);
        /// <summary>
        /// Retrieve a single loan from the database, using its ID as the PKey.
        /// </summary>
        /// <param name="id">Loan Id</param>
        /// <returns>The 'Loan' business object for the requested loan.</returns>
        Loan GetLoan(int id);
        /// <summary>
        /// Returns a collection of all loans found within the database.
        /// </summary>
        /// <returns>A collection of all loans found within the database.</returns>
        ICollection<Loan> GetAllLoans();
        /// <summary>
        /// Update the details of a loan already stored within the database.
        /// </summary>
        /// <param name="loan">The new details of the loan to update. ID must remain the same as it is the PKey.</param>
        void UpdateLoan(Loan loan);
        /// <summary>
        /// Delete data for a single loan from the database.
        /// </summary>
        /// <param name="id">The loan id of the loan to be deleted.</param>
        void DeleteLoan(Loan loan);
        /// <summary>
        /// Delete asset form a loan in the database.
        /// </summary>
        /// <param name="id">The loan id of the loan whos assets are to be deleted.</param>
        /// <param name="assets">The assets to delete</param>
        void DeleteLoanAsset(int id, string assetId);
        /// <summary>
        /// Checks if a certain asset can be loaned out
        /// </summary>
        /// <param name="assets=Id">The asset to check</param>
        bool IsLoanAssetAvailable(string assetId);
    }
}
